package com.jintoufs.service.weixin.impl;

import com.jintoufs.dao.wxpay.PayBackMapper;
import com.jintoufs.dao.wxpay.PayInfoDao;
import com.jintoufs.domain.wxpay.PayBack;
import com.jintoufs.domain.wxpay.PayInfo;
import com.jintoufs.service.weixin.WxPayService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * Created by yangpeng on 2018/1/19.
 */
@Service("wxPayServiceImpl")
public class WxPayServiceImpl implements WxPayService{

    @Resource
    private PayInfoDao payInfoDao;

    @Resource
    private PayBackMapper payBackMapper;

    @Override
    public PayInfo savePayInfo(PayInfo payInfo) {
        payInfoDao.insertSelective(payInfo);
        return payInfo;
    }

    @Override
    public Integer delPayInfo(String id) {
        return payInfoDao.deleteByPrimaryKey(id);
    }

    @Override
    public PayInfo selectPayInfoById(String id) {
        return payInfoDao.selectByPrimaryKey(id);
    }

    @Override
    public PayBack savePayBack(PayBack payBack) {
        payBackMapper.insertSelective(payBack);
        return payBack;
    }

    @Override
    public PayBack selectById(String id) {
        return payBackMapper.selectByPrimaryKey(id);
    }

    @Override
    public PayBack selectByTrasactionId(String id) {
        return payBackMapper.selectByTrasactionId(id);
    }
}
